package com.m3958.firstgwt.server.camel;

import org.apache.camel.impl.DefaultCamelContext;

import com.google.inject.Inject;
import com.google.inject.Singleton;

@Singleton
public class CamelService {
	/**
	 * 如果自己启动camel的话，就失去了应用camel annotion的机会。
	 * @param context
	 * @param er
	 * @throws Exception
	 */
	
	@Inject
	public CamelService(DefaultCamelContext context,
						ExampleRouter er,
						SolrRouter sr) throws Exception{
		context.addRoutes(er);
		context.addRoutes(sr);
		context.start();
	}
}
